package com.kd.service.recruiter.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kd.bean.recruiter.Rec_news;
import com.kd.dao.recruiter.IRec_newsDao;
import com.kd.service.recruiter.IRec_newsService;

@Service
@Transactional
public class Rec_newsServiceImpl implements IRec_newsService{

	@Autowired
	private IRec_newsDao recNewDao;
	
	@Override
	public PageInfo<Rec_news> queryAllRec_news_status(Integer pageNum, Integer pageSize, Integer recruiter_id)
			throws Exception {
		PageHelper.startPage(pageNum, pageSize);
		List<Rec_news> list = recNewDao.queryAllRec_news_status(recruiter_id);
		PageInfo<Rec_news> info = new PageInfo<>(list); 
		return info;
	}

	@Override
	public Boolean updateRec_news_visit_state(Integer rec_news_id, Integer rec_news_visit_state) throws Exception {
		
		return recNewDao.updateRec_news_visit_state(rec_news_id, rec_news_visit_state)>0;
	}

	@Override
	public PageInfo<Rec_news> queryRec_newsBybasic_id(Integer pageNum, Integer pageSize, Integer basic_id)
			throws Exception {
		PageHelper.startPage(pageNum, pageSize);
		List<Rec_news> list = recNewDao.queryRec_newsBybasic_id(basic_id);
		PageInfo<Rec_news> info = new PageInfo<>(list);
		return info;
	}

	

}
